package com.bsoft.gol.hcs.visitrecord.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * @author fzy91
 * @title: vrSynchroSettings
 * @projectName GOL-ssdev4
 * @description: 诊疗数据同步设置表
 * @date 2022/5/3010:16
 */
@Entity
@Table(name = "vr_synchro_settings")
public class VrSynchroSettings implements Serializable {
    //序号，主键
    private Integer id;
    //类型
    private String dateType;
    //类型code
    private Integer settingType;
    //机构id
    private String orgId;
    //初始化起始时间
    private Date beginTime;
    //存储有效期（月）
    private Integer storageMonth;
    //最后修改人ID
    private String lastModifyUserId;
    //最后修改人名称
    private String lastModifyUserName;
    //最后修改时间
    private Date lastModifyTime;


    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Basic
    @Column(name = "date_type")
    public String getDateType() {
        return dateType;
    }

    public void setDateType(String dateType) {
        this.dateType = dateType;
    }
    @Basic
    @Column(name = "setting_type")
    public Integer getSettingType() {
        return settingType;
    }

    public void setSettingType(Integer settingType) {
        this.settingType = settingType;
    }

    @Basic
    @Column(name = "org_id")
    public String getOrgId() {
        return orgId;
    }

    public void setOrgId(String orgId) {
        this.orgId = orgId;
    }

    @Basic
    @Column(name = "begin_time")
    public Date getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(Date beginTime) {
        this.beginTime = beginTime;
    }

    @Basic
    @Column(name = "storage_month")
    public Integer getStorageMonth() {
        return storageMonth;
    }

    public void setStorageMonth(Integer storageMonth) {
        this.storageMonth = storageMonth;
    }

    @Basic
    @Column(name = "last_modify_user_id")
    public String getLastModifyUserId() {
        return lastModifyUserId;
    }

    public void setLastModifyUserId(String lastModifyUserId) {
        this.lastModifyUserId = lastModifyUserId;
    }

    @Basic
    @Column(name = "last_modify_user_name")
    public String getLastModifyUserName() {
        return lastModifyUserName;
    }

    public void setLastModifyUserName(String lastModifyUserName) {
        this.lastModifyUserName = lastModifyUserName;
    }

    @Basic
    @Column(name = "last_modify_time")
    public Date getLastModifyTime() {
        return lastModifyTime;
    }

    public void setLastModifyTime(Date lastModifyTime) {
        this.lastModifyTime = lastModifyTime;
    }


    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"id\":")
                .append(id);
        sb.append(",\"dateType\":\"")
                .append(dateType).append('\"');
        sb.append(",\"beginTime\":\"")
                .append(beginTime).append('\"');
        sb.append(",\"storageMonth\":")
                .append(storageMonth);
        sb.append(",\"lastModifyUserId\":\"")
                .append(lastModifyUserId).append('\"');
        sb.append(",\"lastModifyUserName\":\"")
                .append(lastModifyUserName).append('\"');
        sb.append(",\"lastModifyTime\":\"")
                .append(lastModifyTime).append('\"');
        sb.append('}');
        return sb.toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof VrSynchroSettings)) return false;
        VrSynchroSettings that = (VrSynchroSettings) o;
        return Objects.equals(getId(), that.getId()) &&
                Objects.equals(getDateType(), that.getDateType()) &&
                Objects.equals(getBeginTime(), that.getBeginTime()) &&
                Objects.equals(getStorageMonth(), that.getStorageMonth()) &&
                Objects.equals(getLastModifyUserId(), that.getLastModifyUserId()) &&
                Objects.equals(getLastModifyUserName(), that.getLastModifyUserName()) &&
                Objects.equals(getLastModifyTime(), that.getLastModifyTime());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId(), getDateType(), getBeginTime(), getStorageMonth(), getLastModifyUserId(), getLastModifyUserName(), getLastModifyTime());
    }
}

